#!/usr/bin/perl

use strict;
package osaddaccess;
use modules::encode;

sub osaddaccess {

    my ($dbh,$remote,$input,$osnum) = @_;
    my $sth;my $auth;
    if ($$input[5] eq "") {
	print $remote "$osnum O $$input[0] :Syntax :ADDACCESS <channel> <nick> <level>\n";
    }
    else {
	$sth=$dbh->prepare("SELECT auth FROM ninfo WHERE num = '$$input[0]' AND code = '".encode::encode($$input[0])."';");
	$sth->execute;
	if (! $auth = $sth->fetchrow_array ) {
	    print $remote "$osnum O $$input[0] :Not authed.\n";
	}
	else {
	    $sth=$dbh->prepare("SELECT cslvl FROM nicknames WHERE rnick = '$auth';"); 
	    $sth->execute;



